package com.lcredu.springboot.comtroller;

import com.lcredu.springboot.entity.Car;
import com.lcredu.springboot.entity.Monster;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;

/**
 * @author 黎长容
 * @date 2025-08-12 21:44
 */
@Controller
public class ResponseController {
    @ResponseBody
    @GetMapping("/get/monster")
    public Monster getMonster() {
        Monster monster = new Monster();
        monster.setId(1);
        monster.setName("牛魔王");
        monster.setAge(5000);
        monster.setBirth(new Date());
        monster.setIsMarried(true);
        Car car = new Car();
        car.setName("奔驰");
        car.setPrice(2022.22);
        monster.setCar(car);
        return monster;
    }
}
